3ff6e2cf0d2a04c9bece640a0e2fb15799fdbde4,source/com/intellij/openapi/vfs/impl/local/LocalFileSystemImpl.java,LocalFileSystemImpl,findFileByPath,#String#boolean#boolean#,241

Before Change


        final String name = tokenizer.nextToken();
        if (".".equals(name)) continue;
        if ("..".equals(name)) {
          runPath = runPath.substring(0, runPath.lastIndexOf("/"));
          root = root.getParent();
          if (root == null) return null;
        }

After Change


    initRoots();
    for (VirtualFile root : myFSRootsToPaths.keySet()) {
      //noinspection NonConstantStringShouldBeStringBuffer
      String runPath = root.getPath();
      if (runPath.endsWith("/")) runPath = runPath.substring(0, runPath.length() - 1);
      if (!FileUtil.startsWith(path, runPath)) continue;
      if (path.length() == runPath.length()) return root;
      String tail;
      if (path.charAt(runPath.length()) == '/') {
        tail = path.substring(runPath.length() + 1);
      }
      else if (StringUtil.endsWithChar(runPath, '/')) {
        tail = path.substring(runPath.length());
      }
      else {
        continue;
      }
      StringTokenizer tokenizer = new StringTokenizer(tail, "/");
      while (tokenizer.hasMoreTokens()) {
        final String name = tokenizer.nextToken();
        if (".".equals(name)) continue;
        if ("..".equals(name)) {
          final int index = runPath.lastIndexOf("/");
          if (index >= 0) {
            runPath = runPath.substring(0, index);
          }
          root = root.getParent();
          if (root == null) return null;